<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <p>handler.constructor()方法用于拦截new操作符</p>
    <script>
        function monster1(disposition) {
            this.disposition = disposition;
        }

        const handler = {

            construct: function (target, argumentsList, newtarget) {
                debugger;
                return new target(...argumentsList)
            }
        }

        const proxy1 = new Proxy(monster1, handler)

        console.log(new proxy1('dushenyan'))
    </script>
</body>

</html>